package handler

import (
	"fmt"
	"lnzw/common/proto/cs_gen"
	"lnzw/server/test/test_fyne/test_3/data"

	"google.golang.org/protobuf/proto"
)

func ReqLogin(req proto.Message, rsp proto.Message) {
	reqParams := req.(*cs_gen.ReqLogin)
	name := reqParams.Account
	pwd := reqParams.Password
	fmt.Println("reqParams:", name, pwd)
	if !data.CheckLogin(name, pwd) {
		rspRs := rsp.(*cs_gen.ResLogin)
		rspRs.Result = cs_gen.ErrorCode_ERR_ACCOUNT_OR_PASSWORD
		return
	}
}
